package com.example.qxfw.yjqx.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.example.qxfw.common.entity.yj.ImpGoal;
import com.example.qxfw.yjqx.mapper.ImpGoalMapper;
import com.example.qxfw.yjqx.service.ImpGoalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ImpGoalServiceImpl implements ImpGoalService {

    @Autowired
    private ImpGoalMapper impGoalMapper;

    @Override
    public List<ImpGoal> getList(String targetName, String targetType, String principalName) {
        return impGoalMapper.selectList(Wrappers.<ImpGoal>lambdaQuery()
                .like((targetName!=null && !targetName.equals("")),ImpGoal::getTargetname,targetName)
                .like((targetType!=null && !targetType.equals("")),ImpGoal::getTargettype,targetType)
                .like((principalName!=null && !principalName.equals("")),ImpGoal::getPrincipalname,principalName));
    }

    @Override
    public List<ImpGoal> getList1() {
        return impGoalMapper.selectList(null);
    }
}
